-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(ai): Live API #15309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ai): Live API #15309
Conversation
Generated by 🚫 Danger |
Please audit public API and change mutable stored properties to immutable lets if possible. |
FirebaseAI/Sources/Types/Public/Live/LiveGenerationConfig.swift
Outdated
Show resolved
Hide resolved
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces support for the Live API, a significant feature enabling real-time, bidirectional communication with the model. The changes are extensive, adding new public-facing classes like LiveGenerativeModel
and LiveSession
, along with a robust internal infrastructure to handle WebSocket communication, including a LiveSessionService
actor and numerous data models for client/server messages.
Overall, the implementation is of very high quality. The separation of concerns is excellent, with clear distinctions between public API, internal services, and low-level networking. The use of modern Swift concurrency features like actors and async streams is well-executed. Error handling is also very thorough, with specific, descriptive error types for the new Live API.
I've identified one high-severity issue related to a hardcoded URL that would prevent testing against non-production environments, and a medium-severity issue regarding the WebSocket delegate setup. My feedback is focused on improving the robustness and correctness of the new networking layer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Please do a round of testing before merging.
Adds support for the Live API through a new
LiveSession
struct, which is facilitated through a newliveModel
method onFirebaseAI
. This includes support for the realtime api, as well as the incremental api.This PR also adds support for the
id
field inFunctionCallPart
.Fixes #15147